/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gastronomico.demo.web;

import com.gastronomico.demo.domain.TipoUsuario;
import com.gastronomico.demo.service.TipoUsuarioService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author MIGUELANGEL
 */
@Controller
public class TipoUsuarioListaController {

    @Autowired
    TipoUsuarioService service;

    @RequestMapping(value = "/tipoUsuarioLista.htm", method = RequestMethod.GET)
    public ModelAndView tipoUsuario(){
        ModelAndView mav = new ModelAndView("tipoUsuarioLista");
        List<TipoUsuario> tipoUsuarioLista = service.obtenerTipoUsuarios();
        mav.addObject("tipoUsuarioLista", tipoUsuarioLista);
        return mav;
    }

}
